@model IEnumerable<University.Models.Account>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Login
        </th>
        <th>
            Password
        </th>
        <th>
            Email
        </th>
        <th>
            Role
        </th>
        <th>
            User
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.AccountId }) |
            @Html.ActionLink("Details", "Details", new { id=item.AccountId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.AccountId })
        </td>
        <td>
			@item.Login
        </td>
        <td>
			@item.Password
        </td>
        <td>
			@item.Email
        </td>
        <td>
			@item.Role
        </td>
        <td>
			@(item.User == null ? "None" : item.User.LastName)
        </td>
    </tr>
}

</table>


